package cn.funeralobjects.ams.entity;

import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author FuneralObjects
 * Create date: 2020/6/1 4:00 AM
 */
@Table(name = "t_prod_api_access")
@Entity
@Data
@Accessors(chain = true)
public class EProductApiAccess implements Serializable {

    @EmbeddedId
    private EProductApiAccessPk pk;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "access_id")
    private EAccess eAccess;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "prod_api_id", insertable = false, updatable = false)
    @MapsId("prodApiId")
    private EProductApi productApi;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "prod_res_id", insertable = false, updatable = false)
    @MapsId("prodResId")
    private EProductRes productRes;
}
